package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 组织品牌关系,维修站车系关系
 * </p>
 *
 * @author maxingjian
 * @since 2019-08-29
 */
@TableName("tr_dealer_org_relation")
public class TrDealerOrgRelationPO extends DMSBasePO<TrDealerOrgRelationPO> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "ORG_RELATION_ID", type = IdType.AUTO)
    private Integer orgRelationId;
    /**
     * 组织ID
     */
    @TableField("ORG_ID")
    private Integer orgId;

    /**
     * 品牌ID,车系ID
     */
    @TableField("BILL_ID")
    private Integer billId;

    /**
     * 品牌ID,车系ID
     */
    @TableField(value = "BILL_ID",exist = false)
    private Integer billId2;
    /**
     * 类型(品牌,车系)
     */
    @TableField("BILL_TYPE")
    private Integer billType;
    /**
     * 上端下发数据ID
     */
    @TableField("SOURCE_ID")
    private Integer sourceId;
    /**
     * 上端下发数据日期
     */
    @TableField("SOURCE_CHANGED_AT")
    private LocalDateTime sourceChangedAt;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Integer isDeleted;

    @TableField("EXT")
    private String ext;

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public TrDealerOrgRelationPO() {
        super();
    }


    public Integer getOrgRelationId() {
        return orgRelationId;
    }

    public void setOrgRelationId(Integer orgRelationId) {
        this.orgRelationId = orgRelationId;
    }

    public Integer getBillId2() {
        return billId2;
    }

    public void setBillId2(Integer billId2) {
        this.billId2 = billId2;
    }

    public Integer getOrgId() {
        return orgId;
    }

    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }

    public Integer getBillId() {
        return billId;
    }

    public void setBillId(Integer billId) {
        this.billId = billId;
    }

    public Integer getBillType() {
        return billType;
    }

    public void setBillType(Integer billType) {
        this.billType = billType;
    }

    public Integer getSourceId() {
        return sourceId;
    }

    public void setSourceId(Integer sourceId) {
        this.sourceId = sourceId;
    }

    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }

    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }

    @Override
    public Integer getIsDeleted() {
        return isDeleted;
    }

    @Override
    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }


    @Override
    protected Serializable pkVal() {
        return this.orgRelationId;
    }

    @Override
    public String toString() {
        return "TrDealerOrgRelationPO{" +
                "orgRelationId=" + orgRelationId +
                ", orgId=" + orgId +
                ", billId=" + billId +
                ", billType=" + billType +
                ", sourceId=" + sourceId +
                ", sourceChangedAt=" + sourceChangedAt +
                ", isDeleted=" + isDeleted +
                '}';
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author maxingjian
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "orgRelationId");
    }


}
